<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('noitce', function (Blueprint $table) {
            $table->id();
            $table->json('title')->nullable();
            $table->json('content')->nullable();
            $table->tinyInteger('delay_type')->comment('定时类型，1：每时，2：每天，3：每周，4：每月');
            $table->string('delay_hour_minute')->nullable()->comment('执行时分');
            $table->string('delay_hour_minute_end')->nullable()->comment('结束执行时分(每时)');
            $table->string('delay_day')->nullable()->comment('执行某天 或 执行时/次');
            $table->tinyInteger('is_delay_limit')->default(0)->comment('是否不限制次数');
            $table->tinyInteger('delay_limit')->default(0)->comment('执行剩余次数');
            $table->tinyInteger('notice_type')->default(0)->comment('提醒类型，0：默认，64：提醒，48：警告');
            $table->tinyInteger('status')->default(0)->comment('是否开启');
            $table->string('remote_ip');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('noitce');
    }
};
